let externals = {
  'vue': 'Vue',
  'vuex': 'Vuex',
  'vue-router': 'VueRouter',
  'vue-resource': 'VueResource',
  'axios': 'axios',
  'mint-ui': 'MINT',
  'element-ui': 'ELEMENT',
}
module.exports = {
  // 基本路径
  publicPath: process.env.VUE_APP_BASE_URL, //process.env.NODE_ENV ==='production' ? './' : process.env.VUE_APP_BASE_URL,
  // 输出文件目录
  outputDir: 'dist',
  assetsDir: 'static',
  // 禁止文件名后的哈希值
  filenameHashing: false,
  // eslint-loader 是否在保存的时候检查
  lintOnSave: false,
  // 生产环境是否生成 sourceMap 文件
  productionSourceMap: false,
  // css相关配置
  css: {
    // 是否使用css分离插件 ExtractTextPlugin
    extract: true,
    // 开启 CSS source maps?
    sourceMap: false,
    // css预设器配置项
    loaderOptions: {},
    // 启用 CSS modules for all css / pre-processor files.
    modules: false
  },
  configureWebpack: {
    externals
  },
  parallel: require('os').cpus().length > 1,
  // PWA 插件相关配置
  pwa: {},
  devServer: {
    open: process.platform === 'darwin',
    host: 'localhost',
    port: 8090,
    https: false,
    hotOnly: false,
    proxy: null, // 设置代理
    // proxy: {
    //   '/api': {
    //     target: 'http://dev.ule.com:12020',
    //     changeOrigin: true,
    //     pathRewrite: {
    //       '^/api': ''
    //     }
    //   }
    // },
    before: app => {}
  },
  // 第三方插件配置
  pluginOptions: {

  },
  chainWebpack: config => {
    // 移除 prefetch 插件
    config.plugins.delete('prefetch-index')
    config.plugins.delete('prefetch-mall')
    config.plugins.delete('prefetch-cs')
    config.plugins.delete('prefetch-merchant')
  },
  pages: {
    index: {
      // entry for the page
      entry: 'src/main.ts',
      // the source template
      template: 'public/index.html',
      // output as dist/index.html
      filename: 'index.html',
      // when using title option,
      // template title tag needs to be <title><%= htmlWebpackPlugin.options.title %></title>
      title: 'app',
      // chunks to include on this page, by default includes
      // extracted common chunks and vendor chunks.
      chunks: ['chunk-vendors', 'chunk-common', 'index']
    }
  }
};